/*
 * @Author: jianglijun 
 * @Date: 2019-04-20 21:29:16 
 * @Last Modified by: jianglijun
 * @Last Modified time: 2019-04-22 19:07:14
 */
const db = require("../utils/db.js");
module.exports = {
    
    /******************** 查询用户名是否存在但不是返回一条记录   ********************** */
    findByusername:async username =>  {
        return await db.q("select id,username,password,telephone from user where username =?",username);
    },

    /******************** 用户注册   ********************** */
    registerMyuser: async (...userParm) => {
        return await  db.q(`insert into user 
        (username,password,telephone,email,sex,grade) values (?,?,?,?,?,?)`,
        userParm)
    },
    
    /******************** 用户所有音乐  ********************** */
    getMusicAll: async (...userParm) => {
        return await db.q("select title,singer,time,file,filelrc,uid,mid,data from music where uid =?",userParm);
    }
}